Magnetic sensors in combination with permanent magnets or magnetized components can be used to sense the speed of mechanical components. For example, if a magnetic sensor is placed at close distance from a magnetized wheel, whose circumference is divided into sections alternatively magnetized as magnetic south and north, the magnetic sensor will sense a periodic magnetic field as the wheel rotates. By analyzing the output of the sensor and knowing the mechanical construction of the wheel, it is possible to determine, for example, the frequency of the time varying magnetic field at the sensor location and, consequently, the angular speed of the wheel.
In some applications, only specific positions of the mechanical part need to be detected. This translates in the detection of the instants at which the output of the magnetic sensor has particular values. For example, in many practical cases, it is interesting to identify the instants of the zero-crossing of the magnetic field.
In other applications, a permanent magnet is attached to a mechanical part and in order to measure the angle of rotation of such part, the direction of the magnetic field is sensed by an angular magnetic sensor.
Any error in the sensor or in its readout, such as any offset superimposed onto the signal, will cause an error in the determination of the zero crossings. In many magnetic sensors, such as Anisotropic Magnetic Resistance (AMR) sensors, offset can be even larger than the signal amplitude, resulting in unacceptable errors or even in no detection. Moreover, if any offset is present in the magnetic domain, such as any DC stray field parallel to the field to be sensed, many conventional techniques for offset cancellation do not work properly.
Offset can be extrapolated by observing the sensor output signal for a limited amount of time and fitting it with the expected signal. However, this is unpractical if the signal is observed for less than one period and requires the knowledge of some characteristics of the signal (e.g., shape, amplitude, frequency) which are not always available. Alternatively, the offset can be obtained by averaging one period of the sensor output signal and without any prior knowledge about the signal properties. However, in some applications, such as in the detection of the speed of car wheels at start up, it is not allowed to wait for a full period of the output signal before generating the first accurate zero-crossing signal. This stringent time constraint is due to the fact that in such cases, sub-Hz magnetic fields are observed and waiting for a full period of the signal would result in a too large latency.
A common solution to the above problems is calibration of the offset during testing. This can be done by laser trimming of the sensor or by measuring the offset during testing and using feed-forward compensation during normal operation. However, such techniques increase the testing costs and may result in inaccurate results due to offset variations caused by temperature changes or ageing.
There may thus be a need for a simple and cost efficient way of obtaining accurate detection of zero-crossing, in particular without additional calibration and with only limited information about the signal.